import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

import etxt2db.api.ClassificationExecutor;
import etxt2db.api.ClassificationModel;
import etxt2db.api.ClassificationModelCreator;
import etxt2db.serialization.ClassificationModelSerializer;


public class ClassifyTime {


	public static void main(String[] args) throws IOException, ParseException {
		ClassificationModelCreator creator = new ClassificationModelCreator();
		ClassificationModel an = creator.createRegexClassificationModel("[0-9]?[0-9]:[0-9][0-9]?[ ]*((p|P)(\\.)?(m|M)(\\.)?|(a|A)(\\.)?(m|M)(\\.)?)?","time");
		
		ClassificationModelSerializer serial = new ClassificationModelSerializer();
		serial.serializeClassificationModel(an, "./resources/annotators/timeRegex.ann");
		File ficheiroTeste = new File("./resources/test/");
		ClassificationExecutor executor = new ClassificationExecutor(); 
		
		ArrayList<String> lista = new ArrayList<String>();
		lista.add("time");
		executor.printClassificationResults(ficheiroTeste, an, lista);
	}

}
